[PATCH] libs: jpegparser: boundary checks before copying it
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 11 Feb 2026 21:07:49 +0000 (22:07 +0100)
committerMoritz Mühlenhoff <jmm@debian.org>
Mon, 30 Mar 2026 21:57:55 +0000 (23:57 +0200)
Gbp-Pq: Name CVE-2026-3082.patch

gst-libs/gst/codecparsers/gstjpegparser.c

index 0cb5d0b73983353362481e1b6a99e72187099ed8..fd66f6cfdf5fc2b893ec8be0abdffe49a0ae3f55 100644 (file)
@@ -77,6 +77,10 @@ ensure_debug_category (void)
 
 #define READ_BYTES(reader, buf, length) G_STMT_START {          \
     const guint8 *vals;                                         \
+    if (length > sizeof (buf)) {                                \
+      GST_WARNING ("data size is bigger than its storage");     \
+      goto failed;                                              \
+    }                                                           \
     if (!gst_byte_reader_get_data (reader, length, &vals)) {    \
       GST_WARNING ("failed to read bytes, size:%d", length);    \
       goto failed;                                              \